package OnTheBeachDB;
use strict;
use base qw/DBIx::Class::Schema/;
our $VERSION = 0;

__PACKAGE__->load_classes;
__PACKAGE__->load_components('+DBIx::Class::Schema::Versioned');
__PACKAGE__->upgrade_directory('sql/');
__PACKAGE__->backup_directory('sql/backups/');

sub backup {
	my ($self) = @_;

	# my special backup process
}

sub upgrade {
	my ($self) = @_;

	## overridable sub, per default just runs all the commands.

	$self->run_upgrade(qr/create/i);
	$self->run_upgrade(qr/alter table .*? add/i);
	$self->run_upgrade(qr/alter table .*? (?!drop)/i);
	$self->run_upgrade(qr/alter table .*? drop/i);
	$self->run_upgrade(qr/drop/i);
	$self->run_upgrade(qr//i);
}
1;
